﻿@model CantinhodaCegonha.Models.LogOnModel
@using CantinhodaCegonha.Models.Helpers;
@{
    ViewBag.Title = "Login cantinho da cegonha";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function ($) {
        var inputs = document.getElementsByTagName("input");
        for (var i = 0; i < inputs.length; i++) {
            // test to see if the hint span exists first
            if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
                // the span exists!  on focus, show the hint
                inputs[i].onfocus = function () {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
                }
                // when the cursor moves away from the field, hide the hint
                inputs[i].onblur = function () {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "none";
                }
            }
        }
        // repeat the same tests as above for selects
        var selects = document.getElementsByTagName("select");
        for (var k = 0; k < selects.length; k++) {
            if (selects[k].parentNode.getElementsByTagName("span")[0]) {
                selects[k].onfocus = function () {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
                }
                selects[k].onblur = function () {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "none";
                }
            }
        }

    });


</script>

<div class="leftCol">
@Html.Partial("_PubVertical")

<div class="clear"></div>
</div>

<div class="centerCol" style="width:750px;margin-left:40px;">	

<h1>Bem-vindo(a). Adoramos tê-lo(a) por cá. </h1>
<p>
    Se ainda não criou uma conta, por favor <b style="font-size:17px">@Html.ActionLink("registe-se", "Register")</b> no cantinho da cegonha.
</p>
<p>Caso não se recorde da password. Tente @Html.ActionLink("recuperá-la", "RecoverPassword").</p>

@Html.ValidationSummary(true, "Login incorrecto. Por favor corriga os erros e tente novamente.")

<div>
@using (Html.BeginForm()) {
    <div>
        <fieldset class="fieldset_log">
        <ol>
            <li><div>
                @Html.LabelFor(m => m.UserName)
                <input type="text" name="UserName" id="UserName" class="input-text"/>
                <span class="hint">Insira o email que utilizou para efectuar o registo no cantinho da cegonha.<span class="hint-pointer">&nbsp;</span></span>
                @Html.ValidationMessageFor(m => m.UserName)
            </div>
            </li>
            <li><div>
                @Html.LabelFor(m => m.Password)
                <input type="password" name="Password" id="Password" class="input-text"/>
                <span class="hint">Insira a password que utilizou para efectuar o registo no cantinho da cegonha.<span class="hint-pointer">&nbsp;</span></span>
                @Html.ValidationMessageFor(m => m.Password)
            </div>
            </li>
            <li>
	            <div><div class="cb-wrapper">
                @Html.LabelFor(m => m.RememberMe, new { style = "width:175px" })
                    <input type="checkbox" class="input-checkbox" name="RememberMe" id="RememberMe" value="true" checked="checked" style="margin-left: 50px; margin-top: 12px;"/>
                </div>
	            </div>
            </li>

            <li style="text-align:center">
                <input type="submit" value="Prosseguir com o login"/>
            </li>

       </ol>
    </fieldset>
    <br />
    </div>
    
}
</div>
<div class="clear"></div>
</div>

<div class="clear"></div>


<script type="text/javascript">

    $("fieldset ol input, fieldset ol select, fieldset ol textarea").focus(function () {
        $(this).parents('li:eq(0)').addClass('form-field-focus');
    });
    $("fieldset ol input, fieldset ol select, fieldset ol textarea").blur(function () {
        $("li.form-field-focus").removeClass('form-field-focus');
    });

</script>
